function [ numB, numW ] = CountBWPixel( image, mask, vWhite, sWhite, vBlack )
%CountBWPixel Counts the pixel which refer to black and white concerning
%the parameter

hsv = rgb2hsv(image);
s = hsv(:,:,2);
v = hsv(:,:,3);
s(mask == 1) = 1;
v(mask == 1) = (vWhite + vBlack) / 2;

sumPix = sum((mask(:) == 0));

B = zeros(size(s));
W = zeros(size(s));
B(v < vBlack) = 1;
W(v > vWhite & s < sWhite) = 1;

numB = sum(B(:)) / sumPix;
numW = sum(W(:)) / sumPix;

end

